package test.yzx.pproject.act3;

import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import java.io.File;
import java.io.FileFilter;

public class FileFilterTestActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        File f = Environment.getExternalStorageDirectory();

        File[] sub = f.listFiles(new FileFilter() {
            public boolean accept(File pathname) {
                return false;
            }
        });


        if(sub==null)
            Toast.makeText(this, "null", Toast.LENGTH_SHORT).show();
        else
            Toast.makeText(this, ""+sub.length, Toast.LENGTH_SHORT).show();

    }

}
